package com.boot.sms;

public class SmsService {
    private final SmsProperties properties;

    public SmsService(SmsProperties properties) {
        //模拟配置，初始化短信客户端
        this.properties = properties;
        System.out.println("配置sms：" + properties);
    }

    public String send(String phone, String templateCode, String content) {
        //模拟发送
        String message = String.format("Send Sms to %s: [%s] %s(Sign：%s, Region：%s)",
                phone, templateCode, content, properties.getSignName(),properties.getRegion());
        System.out.println(message);
        return content == null ? "success" : content;
    }
}
